//
//  Post.swift
//  skincare
//
//  Created by whu125 on 2023/5/18.
//

import Foundation
struct PostResponse: Codable {
    let content: [PostModel]
    let pageable: Pageable
    let totalElements: Int
    let last: Bool
    let totalPages: Int
    let sort: Sort
    let first: Bool
    let numberOfElements: Int
    let size: Int
    let number: Int
    let empty: Bool
}

struct PostModel: Codable{
  //  let id:UUID
    let postId: Int
    let body: String
    let viewCount: Int
    let commentCount: Int
    let likes: Int
    let publishTime: Int
    let userId: Int
    let account: String
    let user: PostUser
    let liked: Bool
    let urls: [String]
    let photoURL: String
}

struct PostUser: Codable {
    let userId: Int
    let userName: String
    let account: String
    let sex: Int
    let age: Int
    let mobile: String
    let avatarUrl: String
    let petId: Int
    let isAdmin: Bool
    let followed: Bool
}

struct Pageable: Codable {
    let sort: Sort
    let pageSize: Int
    let pageNumber: Int
    let offset: Int
    let paged: Bool
    let unpaged: Bool
}

struct Sort: Codable {
    let sorted: Bool
    let unsorted: Bool
    let empty: Bool
}
